 var user = document.getElementsByTagName("input")[0],
            pass = document.getElementsByTagName("input")[1],
            check = document.getElementsByTagName("input")[2],
            loUser = localStorage.getItem("user") || "";
            loPass = localStorage.getItem("pass") || "";
        user.value = loUser;
        pass.value = loPass;
        if(loUser !== "" && loPass !== ""){
            check.setAttribute("checked","");
        }
    function fn(){
        if(check.checked){
            localStorage.setItem("user",user.value);
            localStorage.setItem("pass",pass.value);
        }else{
            localStorage.setItem("user","");
            localStorage.setItem("pass","");
        }
    }